var env = 'prod';
if(process&&process.env){
    env = process.env.NODE_ENV;
}
import envConfig from '../../config/env'

window.env = env;
window.envConfig = envConfig;

import system from '../../config/system';
window.system = system;
//引入加密库
import { JSEncrypt } from 'jsencrypt';
Vue.prototype.$encryption = function(text){
    if(!system.publicKey){
        console.error("未设置公钥，无法加密")
        //如果未设置publicKey，则无法加密
        return text;
    }
    //password是要加密的对象
    let encryptor = new JSEncrypt() // 新建JSEncrypt对象
    encryptor.setPublicKey(system.publicKey) // 设置公钥
    let encrypText = encryptor.encrypt(text) // 对密码进行加密
    return encrypText
}
